package exam.uit;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class DanhSachTuyenXe extends Activity{
	EditText etMSTuyen;
	TextView tvInfo;
	Button bInfo;
	//private final Context ct;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.danhsachtuyen);
		
		etMSTuyen = (EditText) findViewById(R.id.etMSTuyen);
		bInfo = (Button) findViewById(R.id.bGetInfo);
		tvInfo = (TextView) findViewById(R.id.tvInfo);
		
		bInfo.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				String ms = etMSTuyen.getText().toString();
				DanhSach ds = new DanhSach(DanhSachTuyenXe.this);
				ds.openDatabase();
				String info = ds.getInfo(ms);
				ds.close();
				
				tvInfo.setText(info);
				
				
			}
		});
	}
	
	
	
	

}
